<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
class CreateCountryCodesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('country_codes', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->char('aleph',1)->comment('首字母');
            $table->char('country')->unique()->comment('国家');
            $table->char('code',4)->unique()->comment('国家代码');
            $table->timestamps();
            $table->comment = '国家代码表';
        });
        DB::statement("alter table `country_codes` comment'国家代码表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('country_codes');
    }
}
